<?php
/*
=====================================================
 Generic Toolbox - by Carl Wells
-----------------------------------------------------
-----------------------------------------------------
 Copyright (c) 2009 Carl Wells
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
=====================================================
 File: system/index.php
-----------------------------------------------------
 Purpose: This file is the base for the control panel.
 All admin functions are run from this view.
=====================================================
*/

// ----------------------------------------------
//  include CONFIG file
// ----------------------------------------------    
 	require_once 'config/config.php';
 
// ----------------------------------------------
//  include SESSION file
// ----------------------------------------------    
 	require_once 'core/sessions.class.php';
	
// ----------------------------------------------
//  Instantiate MAIN CORE class
// ----------------------------------------------    
 	require_once 'core/main.class.php';
 	$MAIN = new main();  
 	
 	$SESS= new Session();
 	
 	if (!$_SESSION['lob']) {
 		echo "There is no session line of business!";
 	}
 	
 	require_once ("users/userController.class.php");
 	$userController = new UserController();
 	
 	
    
// ----------------------------------------------
//  Instantiate generic display class
// ----------------------------------------------    
 	require_once 'display/genericdisplay.class.php';
    $GENDISPLAY = new Genericdisplay();
    echo ($GENDISPLAY->html_header('admin_style.css'));
    
    // OPEN THE BODY FOR OUTPUT
	$GENDISPLAY->body_open();
	
// ----------------------------------------------
//  Instantiate admin display class
// ----------------------------------------------    
	require_once 'display/admindisplay.class.php';
	$ADMDISPLAY = new Admindisplay();
	

	
?>
    
    <div id="maincontainer">

<?php echo ($ADMDISPLAY->display_header()); ?>
<div id="contentwrapper">
<div id="contentcolumn">
<div class="innertube">

<?php $displayController = $MAIN->getAction(); ?>

<?php


	
	
?>

</div>
</div>
</div>

<div id="leftcolumn">
<div class="innertube">
<?php

 echo ($ADMDISPLAY->display_main_admin_nav());

?>
</div>
</div>

<div id="footer"><p>&copy; Caramba Marketing</p></div>

</div>

<?php

// writeTimes($title, $name, $startHour, $startMin, $endHour, $endMin, $interval)
/*require ("functions/extraFunctions.php");
$EXTRAFUNCTIONS  = new ExtraFunctions();
echo ( $EXTRAFUNCTIONS->discountTable("TEXT", "pdf"));*/

// ----------------------------------------------
//  Instantiate cp display class
// ----------------------------------------------    
        
   /* require 'db/dbconnect.class.php';
    $DB = new Connection();
    $DB->connectToServer();
    
    $sql = "SELECT * FROM extraFunctions WHERE `id` = 1";
    $result = $DB->selectQuery($sql);
	
	while($array = mysql_fetch_array($result)) {
	eval($array['code']);
	echo $html;
	}
*/
$GENDISPLAY->body_close();
$GENDISPLAY->html_close();
?>

